<?php 
if($adc->getSetting('model-manager') && is_object($adc->getCurrentAdBrand()) > 0)
{ require($adc->getViewPath().'filters/AdModelsGrid.php'); }
$total = count($adc->getAdBrands());
if($total > 1)
{
	?>
    <div class="<?php if(!$adc->getSetting('CollapseBrand')) { echo 'visible-phone visible-sm'; } ?>">
        <button class="btn btn-block" data-toggle="collapse" data-target=".filter-brands">
            <?php echo ucfirst($txt->getWord(array('display', 'brands'))); ?>
        </button><br />
    </div>
    <div class="filter-brands placement-filter <?php if($adc->getSetting('CollapseBrand')) { echo 'collapse'; } else { echo 'collapse-phone'; } ?>">
    	<div class="placement-filter-padding">
            <div class="row">				
			<?php
				$i = 1;
				$class == 'alpha';
				foreach($adc->getAdBrands() as $brand)
				{
					if(($adc->getCurrentAdCatId() == 0) && ($brand->getBrandOrder() < 10) && (($brand->getAdsCount() > 0) || ($adc->getSetting('ViewEmptyBrand') > 0)))
					{
						$link = $katana->getURL();
						if($adc->getCurrentAdCatId() > 0)
						{ $link .= '/adcat/'.$adc->getCurrentAdCatId().'/'; }
						else
						{ 
							if($brand->getCatId() > 0)
							{ $link .= '/adcat/'.$brand->getCatId().'/'; }
							else
							{
								if($adc->getCurrentAdTypeId() > 0)
								{ $link .= '/adtype/'.$adc->getCurrentAdTypeId().'/'; }
								else
								{ 
									if($brand->getTypeId() > 0)
									{ $link .= '/adtype/'.$brand->getTypeId().'/'; }
									else
									{ $link .= '/adtype/1/'; }
								}
							}
						}
						$link .= 'adbrand/'.$brand->getId().'/';
						if(intval($_GET['bt']) > 0)
						{ $link .= '?bt='.intval($_GET['bt']); }
						?>
                        <div class="prospect-brand col-md-2 col-sm-3 col-xs-4">
							<a class="thumbnail btn-sm text-center <?php echo $class ?>" href="<?php echo $link ?>" title="<?php echo $brand->getTitle() ?>">
                            <?php 
							if($adc->getSetting('BrandImages'))
							{
								if(is_object($brand->getImageObject()))
								{ 
									
									echo '<img alt="'.$brand->getTitle().'" src="'.$brand->getImageObject()->getLink($adc->getSetting('BrandListW'), $adc->getSetting('BrandListH')).'" alt="'.$brand->getTitle().'" /><div class="clearfix"></div>'; 
								}
							}
							?>
							<span itemprop="brand"><?php echo $txt->truncate($brand->getTitle(), 25, '', '') ?></span> (<?php echo $brand->getAdsCount() ?>)</a>
                        </div>
						<?php
						//if(($i%6) == 0)
						//{ echo '</div><div class="row">'; }
						$i++;
					}
				}
				?>
            </div>
        </div><br />
    </div>
    <?php
}
?>